﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Arizu.Repository;
using System.Data;

namespace AiRiZu.User
{
    public partial class PreviousTrips : Common
    {
        public string PreviousTripsString = "您当前没有安排行程。";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["logId"] == null)
            {
                return;
            }
            StringBuilder sBuilder = new StringBuilder();
            AirizuIndent AirizuOrder = AirizuIndent.CreateInstance();
            DataTable dt = AirizuOrder.GetOrderBefore(long.Parse(Session["logId"].ToString()), System.DateTime.Now.Ticks);

            if (dt.Rows.Count > 0)
            {

                sBuilder.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"trips_list\"> <thead>");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    sBuilder.Append(" <tr>");
                    sBuilder.Append("<th width=\"130\">").Append(dt.Rows[i]["State"].ToString()).Append("</th>");
                    sBuilder.Append("<th width=\"340\">").Append(dt.Rows[i]["ReserveInfo"].ToString()).Append("</th>");
                    sBuilder.Append("<th width=\"120\">").Append(dt.Rows[i]["Rent"].ToString()).Append("</th>");
                    sBuilder.Append("<th width=\"200\">").Append(dt.Rows[i]["OwnerId"].ToString()).Append("</th>");
                    sBuilder.Append("<th width=\"110\">").Append(dt.Rows[i]["State"].ToString()).Append("</th>");
                    sBuilder.Append(" </tr>");
                }
                sBuilder.Append("</thead> <tbody> </tbody> </table>");

                PreviousTripsString = sBuilder.ToString();
            }
        }
    }
}
